// 房屋条件
import request from '@/utils/request.js'

/**
 * 获取发布房源的所需的条件
 * @returns
 */
export function getHouseMsg () {
  return request({
    url: '/houses/params'
  })
}
/**
 * 发布房源
 * @param {*} data {
  "title": "整租 · 豪华小区 精装修出租 小区环境幽静",
  "description": "【装修描述】 装修简洁，家电配齐，通风采光效果良好，格局方正。",
  "houseImg": "img1|im2|img3",
  "oriented": "ORIEN|caa6f80b-b764-c2df",
  "supporting": "空调|洗衣机",
  "price": "1234",
  "roomType": "ROOM|ce2a5daa-811d-2f49",
  "size": "123",
  "floor": "FLOOR|1",
  "community": "AREA|93cbbe43-741d-de54"

 * @returns
 */
export function addHouses (data) {
  return request({
    url: '/user/houses',
    method: 'POST',
    data
  })
}/**
 *发布房屋图片
 * @param {*} data 房屋图片
 * @returns
 */
export function addHouseImg (data) {
  return request({
    url: '/houses/image',
    method: 'POST',
    headers: { 'Content-Type': 'multipart/form-data' },
    data
  })
}
/**
 *发布房屋
 * @param {*} data
 * @returns
 */
export function addHouseitem (data) {
  return request({
    url: '/user/houses',
    method: 'POST',

    data
  })
}
/**
 * 获取房屋的查询条件
 * @param {*} data  一级城市的code
 * @returns
 */
export function getHouseCondition (id) {
  return request({
    url: '/houses/condition',
    params: {
      id: id
    }

  })
}
/**
 *根据条件查询小区
 * @param {*} cityId  城市code
 * @param {*} more  筛选结果
 * @returns
 */
export function relevantHouse (params) {
  return request({
    url: '/houses',
    params

  })
}
